package leetcode.datastructure.binarytree;

import common.bean.TreeNode;


public class Program104TreeMaxDepth {

    public Program104TreeMaxDepth() {
    }

    public int maxDepth(TreeNode root) {
        return DFS(root);
    }

    public int DFS(TreeNode root) {
        if (root == null) {
            return 0;
        }
        return 1 + Math.max(maxDepth(root.left), maxDepth(root.right));
    }

    public int BFS(TreeNode root) {
        if (root == null) {
            return 0;
        }

        // todo
        return -1;
    }

    public static void main(String[] args) {
//        Program104TreeMaxDepth myStack = new Program104TreeMaxDepth();
//        System.out.println(myStack.maxDepth()); // 返回 true
    }
}
